﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntityFramework.OT.Demo.UnitTest
{
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    public class TestHelper
    {
        private static readonly Random Random = new Random(Environment.TickCount);
        public static string RandomString(int size)
        {
            Assert.IsTrue(size > 0);
            var builder = new StringBuilder();
            for (int i = 0; i < size; i++)
            {
                char ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * Random.NextDouble() + 65)));
                builder.Append(ch);
            }
            return builder[0] + (size > 1 ? builder.ToString(1, size - 1).ToLower() : string.Empty);
        }
        public static int RandomInt(int min, int max)
        {
            return Random.Next(min, max);
        }
    }
}
